<?php
header('Access-Control-Allow-Origin:*');
define('MODULE_NAME','Api');

require dirname(__FILE__).'/core/fanwe.php';
$fanwe = &FanweService::instance();
$fanwe->initialize();
require fimport('module/api');
$module = new ApiModule();

$action = strtolower($_REQUEST['action']);
if(empty($action))
	exit('Access Denied');
if(!method_exists($module, $action)) {
	exit('Access Denied');
}

define('ACTION_NAME',$action);
call_user_func(array($module, $action));